package com.qd.pay.domain;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class OrderRefundDTO {

    private String rid;

    private String orderId;

    private String thirdPartyOrder;

    private String transactionId;

    private String outRefundNo;

    @NotNull(message = "订单金额不能为空")
    private BigDecimal payAmount;

    @NotNull(message = "退款金额不能为空")
    private BigDecimal refundFee;

    @Size(max = 80, message = "退款说明长度不能超过{max}位")
    private String refundDesc;

    /**
     * 0 微信
     */
    @NotNull(message = "订单类型不能为空")
    private Integer type;

    private String ipAddress;

    private LocalDateTime sendTime;

    private String personId;

    private String apCode;

    private Integer refundNo = 1;

    @Size(max = 256, message = "notifyUrl长度不能超过{max}位")
    private String notifyUrl;

    private String appId;

    public void freeData() {
        this.rid = null;
        this.orderId = null;
        this.transactionId = null;
        this.outRefundNo = null;
        this.payAmount = null;
        this.refundFee = null;
        this.refundDesc = null;
        this.type = null;
        this.thirdPartyOrder = null;
        this.ipAddress = null;
        this.sendTime = null;
        this.personId = null;
        this.apCode = null;
        this.refundNo = null;
        this.notifyUrl = null;
        this.appId = null;
    }
}
